#include "socket.h"

//  ./client server_ip server_port
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        cerr << "erro input,please in:xxx ip port" << endl;
        exit(-1);
    }

    string ip = argv[1];
    uint16_t port = stoi(argv[2]);

    unique_ptr<Udp> uct = make_unique<Udp>(ip, port);

    uct->Creat_socket();
    // 不需要调用bind函数绑定客户端的ip+port,在首次发送数据时会默认自动绑定
    // 客户端ip是由自己端决定，端口必须随机

    uct->Run_client();

    return 0;
}